package structural

import "strings"

type IDecorator interface {
	Draw() string
}

type SDecoratorSquare struct {
	dec IDecorator
}

func (s *SDecoratorSquare) Draw() string {
	var sb strings.Builder
	if s.dec != nil {
		sb.WriteString(s.dec.Draw())
		sb.WriteString(" ")
	}
	sb.WriteString("square")
	return sb.String()
}

type SDecoratorColor struct {
	dec IDecorator
}

func (s *SDecoratorColor) Draw() string {
	var sb strings.Builder
	if s.dec != nil {
		sb.WriteString(s.dec.Draw())
		sb.WriteString(" ")
	}
	sb.WriteString("color")
	return sb.String()
}
